<div class="advertisement" ng-controller="AdvertisementController" ng-init="initList()" style="margin: 0px;">

  <div ng-include="'angular/template/include/toptip.html'">

  </div>

  <div style="margin: -20px -20px 0 -20px;">

    <div class="menu clearfix">
      <a class="pull-left" href="#/tasks"><span class="ionic-icon ion-ios-home"></span></a>
      <a class="pull-right" href="#/profile"><span class="ionic-icon ion-person"></span></a>
    </div>
    <div class="tab-warp">
      <ul class="tab">
        <li class="item" ng-class="type == null ? 'active' : '' "><a href="#/advertisements?customerId={{customerId}}">全部任务</a></li>
        <li class="item" ng-class="type =='SINA_WEIBO' ? 'active' : '' "><a href="#/advertisements?type=SINA_WEIBO&customerId={{customerId}}">微博任务</a></li>
        <li class="item" ng-class="type =='WECHAT'? 'active' : '' "><a href="#/advertisements?type=WECHAT&customerId={{customerId}}">微信任务</a></li>
      </ul>
    </div>
    <div class="top-margin-20 text-center" ng-show="advertisementDtos.length == 0">
      <p class="gray-darker">暂无数据</p>
    </div>
    <ul class="list clearfix" ng-hide="advertisementDtos.length == 0">
      <!--<li class="pull-left" ng-repeat="advertisementDto in advertisementDtos | filter:{created: false}">-->
      <li class="pull-left" ng-repeat="advertisementDto in advertisementDtos">
        <div class="ad">
          <img src="{{qiniuhost}}{{advertisementDto.cover}}!200" alt=""/>
          <div class="ad-content">
            <h3 class="title text-center no-top-margin ellipsis">{{advertisementDto.adTile}}</h3>
            <p class="info text-center" style="font-size: 12px;">{{advertisementDto.reward}}元&nbsp;|&nbsp;余{{advertisementDto.restDay}}天{{advertisementDto.restHour}}小时</p>
            
            <!--  update by Jason.Y at 2015/12/10 ( this code need to change back !)
            <a class="btn btn-blue" href="javascript:void(0);" ng-show="!advertisementDto.created" ng-click="showConfirm(advertisementDto.id)">马上参加</a>
            <a class="btn btn-blue" href="javascript:void(0);" ng-show="advertisementDto.created">已认领</a>
            -->
            
            <a class="btn btn-blue" href="javascript:void(0);" ng-show="advertisementDto.created ==3">已完成</a>
            <a class="btn btn-blue" href="javascript:void(0);" ng-show="advertisementDto.created ==1" ng-click="showConfirm(advertisementDto.id)">马上参加</a>
            <a class="btn btn-blue" href="javascript:void(0);" ng-show="advertisementDto.created ==2">已认领</a>
            
          </div>
        </div>
      </li>
    </ul>
  </div> 
    
  </div>

  
